package org.jeecg.modules.electronicSeal.vo;

public enum DicElectronicCode {
A(-112,"用户已验证"),
B(-113,"用户待审核"),
C(-115,"国家编码错误"),
D(-106,"用户不存在"),
E(-107,"用户状态异常"),
F(-108,"短信发送频繁"),
G(-116,"审核不通过"),
H(-117,"待上传资料"),
I(-111,"短信验证码错误"),
K(-51,"签章获取失败 / 还未生成"),
L(-71,"temoid不正确，找不到对应的文档"),
M(-72,"sealID 不正确，找不到对应的图章"),
N(-41,"身份授权失败"),
O(-42,"json格式不正确"),
P(-43,"不支持该actionType"),
Q(-44,"账号余额不足"),
R(-45,"内部服务器错误"),
S(-46,"请求信息不完整，缺少必传参数值"),
T(-47,"请求信息错误，参数格式不正确"),
U(-49,"恶意攻击，系统拒绝"),
J(-119,"材料错误");


    private int type;

    private String desc;

    private DicElectronicCode(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getValue(int type) {
        DicElectronicCode[] carTypeEnums = values();
        for (DicElectronicCode carTypeEnum : carTypeEnums) {
            if (carTypeEnum.type()==type) {
                return carTypeEnum.desc();
            }
        }
        return null;
    }

    public static int getType(String desc) {
        DicElectronicCode[] carTypeEnums = values();
        for (DicElectronicCode carTypeEnum : carTypeEnums) {
            if (carTypeEnum.desc().equals(desc)) {
                return carTypeEnum.type();
            }
        }
        return 0;
    }

    private int type() {
        return this.type;
    }

    private String desc() {
        return this.desc;
    }
}
